package main

import (
	"fmt"
	"io/ioutil"
	"net/http"
)

func main() {
	fmt.Println("程序开始")

	loadPage("https://movie.douban.com/")
}

func loadPage(url string) {
	response, err := http.Get(url)
	if err != nil {
		fmt.Println("获取网页时出错了")
	}

	fmt.Println(response.Status)
	body, err := ioutil.ReadAll(response.Body)

	if err != nil {
		fmt.Println("读取 body 时出错")
	}

	fmt.Println(string(body))
	fmt.Println("title = ", response.StatusCode)
}
